
import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.ArrayList;

import javax.xml.parsers.ParserConfigurationException;

import org.xml.sax.SAXException;

import sim.ring.method.*;
import sim.ring.technical.TechnicalManager;
import sim.ring.technical.xml.XmlParser;
import sim.ring.tower.*;
import sim.ring.technical.comms.*;

public class Driver {
	
	public static void main (String args[]) {
		new Driver().go();
	}
	
	private void go() {
		int speed=250;
		//TechnicalManager.getInstance();
		
		/*SerialConnection serial = new SerialConnection();
		try {
			serial.connect("COM10", new BellEventListener());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}*/
		
		
		//Tower tower = new Tower("test", "test town", 8, "c#");
		//TowerQueryBuilder.saveTower(tower);
		
		//Method method = MethodFactory.createMethod("Plain","Bob", 8, "-18-18-18-18,12",false);
		//System.out.println("------------------------");
		//System.out.println(method);
		//System.out.println("------------------------");

		//mm.saveMethod(method);
		
		
		Tower tower = TowerQueryBuilder.loadTower(18);
		Method method = MethodQueryBuilder.loadMethod(37739);
		System.out.println("------------------------");
		System.out.println(method);
		System.out.println("------------------------");
		tower.ringMethod(method, speed);
		
		
		
		/*
		ArrayList<Method> methods = null;
		XmlParser parser = new XmlParser();
		try {
			methods=parser.parse();
		} catch (IOException | SAXException | ParserConfigurationException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		for (Method method : methods) {
			NotationManager nm = new NotationManager(method.getShortNotation());
			method.setLongNotation(nm.getLongNotation());
			mm.constructRows(method);
			mm.saveMethod(method);
		}*/
		
	}
}
